<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        const obj1 = {}
        const obj2 = {}

        const map1 = new WeakMap()
        map1.set(obj1,1)
        const map2 = new WeakMap()
        map2.set(obj2,2)

        obj1 = null
        obj2 = null

        console.log(map1.get())
        console.log(map2.get())
    </script>
</body>
</html>